<template>
  <header>
    <slot name="logo"></slot>
    <slot name="scan"></slot>
    <slot name="search"></slot>
    <slot name="goodlist"></slot>
    <section v-if="goBack" class="goBack" @click="this.$router.go(-1)">
      <svg>
        <polyline class="back" points="12,18 4,9 12,0" style="fill:none;stroke:rgb(250,250,250);stroke-width:2"/>
      </svg>
    </section>
    <section class="title_head ellipsis" v-if="headTitle">
      <span class="title_text">{{decodeURI(headTitle)}}</span>
    </section>
  </header>
</template>

<script>
export default {
  name: 'head',
  props: ['headTitle', 'goBack']
}
</script>

<style lang="scss"  scoped>
  @import "../../style/common";
  @import "../../style/mixin";
  header{
    background: $bc2;
    height: 1rem;
    line-height: 1rem;
    position: relative;
    .goBack{
      position: absolute;
      left: 0.2rem;
      top: 0.3rem;
      @include wh(0.6rem,0.4rem);
      svg{
        @include wh(100%,0.6rem);
      }
    }
    .title_text{
       font-size: 0.3rem;
       color: #fff;
     }
  }
</style>
